svm: implement instruction fetch part of DecodeAssist (on #PF/#NPF)
authorKeir Fraser <keir@xen.org>
Mon, 18 Apr 2011 12:36:10 +0000 (13:36 +0100)
committerKeir Fraser <keir@xen.org>
Mon, 18 Apr 2011 12:36:10 +0000 (13:36 +0100)
commitdeb245252e80db10906d42dd831d1927ded9c294
treecbd4612bb15275b855f367222aad04519c9a2faa
parent88f1c41bd86e47a2b18e5cfda4df305287ae30e9
svm: implement instruction fetch part of DecodeAssist (on #PF/#NPF)

Newer SVM implementations (Bulldozer) copy up to 15 bytes from the
instruction stream into the VMCB when a #PF or #NPF exception is
intercepted. This patch makes use of this information if available.
This saves us from a) traversing the guest's page tables, b) mapping
the guest's memory and c) copy the instructions from there into the
hypervisor's address space.
This speeds up #NPF intercepts quite a lot and avoids cache and TLB
trashing.

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
Signed-off-by: Keir Fraser <keir@xen.org>
xen/arch/x86/hvm/emulate.c
xen/arch/x86/hvm/svm/svm.c
xen/include/asm-x86/hvm/hvm.h
xen/include/asm-x86/hvm/svm/vmcb.h